package sample5;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JLabel;

public class MyFrame extends JFrame {
	private final int WIDTH = 600;
	private final int HEIGHT = 400;

	public static void main(String[] args) {
		new MyFrame();
	}

	public MyFrame() {
		setSize(WIDTH, HEIGHT);
		setTitle("Deneme");
		addWindowListener(new WindowAdapter() {
			@Override
			public void windowClosing(WindowEvent e) {
				super.windowClosing(e);
				System.out.println("kapaniyor..");
				System.exit(NORMAL);
			}
		});

		JLabel label = new JLabel("Java Label Ornegi");
		add(label);

		setVisible(true);
	}
}
